package cn.le.enums;

import cn.le.exception.BizException;

public enum EnStatus {

    DELETE(-1,"删除"),
    SUSPEND(0,"暂停"),
    NORMAL(1,"正常");

    EnStatus(int type,String name){
        this.type = type;
        this.name = name;
    }

    private Integer type;
    private String name;

    public Integer getType(){
        return type;
    }
    public static EnStatus valueOf(int type) throws BizException {
        EnStatus[] classType =values();
        for (EnStatus aClassType : classType) {
            if (aClassType.getType() == type) {
                return aClassType;
            }
        }
        throw new BizException("不支持的模板类别");
    }

}
